﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SMTC.Model.Domain;
using SMTC.BO.BaseInfo;
using SMTC.Model.Model;

/// <summary>
/// Summary description for ProductionUnitViewDataSource
/// </summary>
public class ProductionUnitViewDataSource
{
    private ProductionUnitQueryServices _services = new ProductionUnitQueryServices();
    
    public ProductionUnitViewDataSource()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public List<SMT_ProductionUnitModel> Select(string Type, string Abilty, string ModifyPer, 
        string MaintenanceStartTime, string MaintenanceEndTime, string sel,
        string EffectiveTimeStart, string EffectiveTimeEnd, string PUVersion)
    {
        Query_PUModel _Query_PUModel = new Query_PUModel();
        _Query_PUModel.Type = Type;
        _Query_PUModel.Abilty = Abilty;
        _Query_PUModel.ModifyPer = ModifyPer;
        _Query_PUModel.MaintenanceStartTime = MaintenanceStartTime;
        _Query_PUModel.MaintenanceEndTime = MaintenanceEndTime;
        _Query_PUModel.EffectiveTimeStart = EffectiveTimeStart;
        _Query_PUModel.EffectiveTimeEnd = EffectiveTimeEnd;
        _Query_PUModel.PUVersion = PUVersion;
        if (sel == "1")
        {
            return _services.GetProductionUnitForSelect(_Query_PUModel);
        }
        else
        {
            return _services.GetProductionUnit(_Query_PUModel);
        }
    }
}